STEP 8: Let's use the user input to decide what our program does next! We'll use a new section of the toolkit here!

If statements allow us to change the flow of the program depending on user or random input.

  • In LOGIC, click on . Drag out if. The line that you drag out is the test statement.
  • Change the variable to the left of the == to pluto_ans. This is the test variable.
  • In GRAPHICS, click on . Drag out Pluto. Drop it INSIDE your if block.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)